<template>
  <div class="coding-problem-container">
    <!-- 题目头部 -->
    <div class="problem-header">
      <div class="header-content">
        <div class="problem-info">
          <div class="breadcrumb">
            <el-breadcrumb separator="/">
              <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
              <el-breadcrumb-item :to="{ path: '/coding' }">编程实战</el-breadcrumb-item>
              <el-breadcrumb-item>{{ problem.title }}</el-breadcrumb-item>
            </el-breadcrumb>
          </div>

          <h1 class="problem-title">{{ problem.title }}</h1>

          <div class="problem-meta">
            <el-tag :type="getDifficultyType(problem.difficulty)" size="large">
              {{ problem.difficulty }}
            </el-tag>
            <div class="meta-item">
              <el-icon><User /></el-icon>
              <span>{{ problem.submitCount }}人提交</span>
            </div>
            <div class="meta-item">
              <el-icon><CircleCheck /></el-icon>
              <span>通过率 {{ problem.passRate }}%</span>
            </div>
            <div class="meta-item">
              <el-icon><Star /></el-icon>
              <span>{{ problem.rating }}分</span>
            </div>
          </div>

          <div class="problem-tags">
            <el-tag v-for="tag in problem.tags" :key="tag" type="info">{{ tag }}</el-tag>
          </div>
        </div>

        <div class="problem-actions">
          <el-button
            @click="toggleFavorite"
            :type="isFavorited ? 'warning' : ''"
            :icon="isFavorited ? 'StarFilled' : 'Star'"
          >
            {{ isFavorited ? '已收藏' : '收藏' }}
          </el-button>
          <el-button @click="showSolution" icon="Lightbulb">
            查看题解
          </el-button>
        </div>
      </div>
    </div>

    <!-- 主要内容区域 -->
    <div class="problem-content">
      <!-- 左侧题目描述 -->
      <div class="problem-description">
        <el-tabs v-model="activeTab" class="description-tabs">
          <!-- 题目描述 -->
          <el-tab-pane label="题目描述" name="description">
            <div class="description-content">
              <div class="section">
                <h3>题目描述</h3>
                <div class="content" v-html="problem.description"></div>
              </div>

              <div class="section" v-if="problem.inputFormat">
                <h3>输入格式</h3>
                <div class="content" v-html="problem.inputFormat"></div>
              </div>

              <div class="section" v-if="problem.outputFormat">
                <h3>输出格式</h3>
                <div class="content" v-html="problem.outputFormat"></div>
              </div>

              <div class="section" v-if="problem.examples && problem.examples.length">
                <h3>示例</h3>
                <div
                  v-for="(example, index) in problem.examples"
                  :key="index"
                  class="example-item"
                >
                  <h4>示例 {{ index + 1 }}</h4>
                  <div class="example-content">
                    <div class="input-output">
                      <div class="input-section">
                        <strong>输入：</strong>
                        <pre>{{ example.input }}</pre>
                      </div>
                      <div class="output-section">
                        <strong>输出：</strong>
                        <pre>{{ example.output }}</pre>
                      </div>
                    </div>
                    <div v-if="example.explanation" class="explanation">
                      <strong>解释：</strong>
                      <div v-html="example.explanation"></div>
                    </div>
                  </div>
                </div>
              </div>

              <div class="section" v-if="problem.constraints">
                <h3>约束条件</h3>
                <div class="content" v-html="problem.constraints"></div>
              </div>

              <div class="section" v-if="problem.hints && problem.hints.length">
                <h3>提示</h3>
                <ul class="hints-list">
                  <li v-for="hint in problem.hints" :key="hint" v-html="hint"></li>
                </ul>
              </div>
            </div>
          </el-tab-pane>

          <!-- 提交记录 -->
          <el-tab-pane label="提交记录" name="submissions">
            <div class="submissions-content">
              <div class="submissions-header">
                <h3>我的提交记录</h3>
                <el-button @click="refreshSubmissions" icon="Refresh" size="small">
                  刷新
                </el-button>
              </div>

              <div class="submissions-list">
                <div
                  v-for="submission in submissions"
                  :key="submission.id"
                  class="submission-item"
                  :class="getSubmissionClass(submission.status)"
                  @click="viewSubmissionDetail(submission)"
                >
                  <div class="submission-info">
                    <div class="status">
                      <el-icon>
                        <CircleCheckFilled v-if="submission.status === 'ACCEPTED'" />
                        <CircleCloseFilled v-else />
                      </el-icon>
                      <span>{{ getStatusText(submission.status) }}</span>
                    </div>
                    <div class="language">{{ submission.language }}</div>
                    <div class="time">{{ formatTime(submission.submitTime) }}</div>
                  </div>
                  <div class="submission-stats" v-if="submission.status === 'ACCEPTED'">
                    <span>执行时间: {{ submission.runtime }}ms</span>
                    <span>内存消耗: {{ submission.memory }}MB</span>
                  </div>
                </div>
              </div>

              <div v-if="submissions.length === 0" class="empty-submissions">
                <el-empty description="暂无提交记录" />
              </div>
            </div>
          </el-tab-pane>

          <!-- 讨论区 -->
          <el-tab-pane label="讨论区" name="discussions">
            <div class="discussions-content">
              <div class="discussions-header">
                <h3>讨论区</h3>
                <el-button @click="createDiscussion" type="primary" size="small">
                  发起讨论
                </el-button>
              </div>

              <div class="discussions-list">
                <div
                  v-for="discussion in discussions"
                  :key="discussion.id"
                  class="discussion-item"
                  @click="viewDiscussion(discussion)"
                >
                  <div class="discussion-header">
                    <h4>{{ discussion.title }}</h4>
                    <div class="discussion-meta">
                      <span>{{ discussion.author }}</span>
                      <span>{{ formatTime(discussion.createTime) }}</span>
                    </div>
                  </div>
                  <div class="discussion-preview">{{ discussion.preview }}</div>
                  <div class="discussion-stats">
                    <span>{{ discussion.replyCount }}回复</span>
                    <span>{{ discussion.likeCount }}点赞</span>
                  </div>
                </div>
              </div>
            </div>
          </el-tab-pane>
        </el-tabs>
      </div>

      <!-- 右侧代码编辑器 -->
      <div class="code-editor-section">
        <div class="editor-header">
          <div class="language-selector">
            <el-select v-model="selectedLanguage" @change="changeLanguage">
              <el-option
                v-for="lang in supportedLanguages"
                :key="lang.value"
                :label="lang.label"
                :value="lang.value"
              />
            </el-select>
          </div>

          <div class="editor-actions">
            <el-button @click="resetCode" size="small" icon="RefreshLeft">
              重置代码
            </el-button>
            <el-button @click="runCode" size="small" type="success" :loading="runningCode">
              运行代码
            </el-button>
            <el-button @click="submitCode" size="small" type="primary" :loading="submittingCode">
              提交代码
            </el-button>
          </div>
        </div>

        <div class="code-editor">
          <textarea
            v-model="code"
            class="code-textarea"
            :placeholder="getCodeTemplate(selectedLanguage)"
          ></textarea>
        </div>

        <!-- 运行结果 -->
        <div v-if="runResult" class="run-result">
          <div class="result-header">
            <h4>运行结果</h4>
            <el-button @click="runResult = null" icon="Close" size="small" text />
          </div>

          <div class="result-content">
            <div v-if="runResult.success" class="success-result">
              <div class="output-section">
                <strong>输出：</strong>
                <pre>{{ runResult.output }}</pre>
              </div>
              <div class="stats-section">
                <span>执行时间: {{ runResult.runtime }}ms</span>
                <span>内存使用: {{ runResult.memory }}MB</span>
              </div>
            </div>

            <div v-else class="error-result">
              <div class="error-type">{{ runResult.errorType }}</div>
              <pre class="error-message">{{ runResult.errorMessage }}</pre>
            </div>
          </div>
        </div>

        <!-- 提交结果 -->
        <div v-if="submitResult" class="submit-result">
          <div class="result-header">
            <h4>提交结果</h4>
            <el-button @click="submitResult = null" icon="Close" size="small" text />
          </div>

          <div class="result-content">
            <div class="result-status" :class="submitResult.status.toLowerCase()">
              <el-icon>
                <CircleCheckFilled v-if="submitResult.status === 'ACCEPTED'" />
                <CircleCloseFilled v-else />
              </el-icon>
              <span>{{ getStatusText(submitResult.status) }}</span>
            </div>

            <div v-if="submitResult.status === 'ACCEPTED'" class="success-stats">
              <div class="stat-item">
                <span class="label">执行时间:</span>
                <span class="value">{{ submitResult.runtime }}ms</span>
              </div>
              <div class="stat-item">
                <span class="label">内存消耗:</span>
                <span class="value">{{ submitResult.memory }}MB</span>
              </div>
              <div class="stat-item">
                <span class="label">击败用户:</span>
                <span class="value">{{ submitResult.beatPercentage }}%</span>
              </div>
            </div>

            <div v-else class="error-details">
              <div v-if="submitResult.errorCase" class="error-case">
                <strong>错误用例:</strong>
                <div class="case-input">
                  <span>输入: </span>
                  <pre>{{ submitResult.errorCase.input }}</pre>
                </div>
                <div class="case-output">
                  <span>期望输出: </span>
                  <pre>{{ submitResult.errorCase.expectedOutput }}</pre>
                </div>
                <div class="case-actual">
                  <span>实际输出: </span>
                  <pre>{{ submitResult.errorCase.actualOutput }}</pre>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, computed, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import {
  getProblemDetail,
  getProblemSubmissions,
  getProblemDiscussions,
  submitCode,
  runCode,
  favoriteProblem,
  unfavoriteProblem,
  getCodeTemplate
} from '@/api/coding'

const route = useRoute()
const router = useRouter()

const loading = ref(true)
const runningCode = ref(false)
const submittingCode = ref(false)
const activeTab = ref('description')

const problem = ref({})
const submissions = ref([])
const discussions = ref([])
const isFavorited = ref(false)

const selectedLanguage = ref('javascript')
const code = ref('')
const runResult = ref(null)
const submitResult = ref(null)

const supportedLanguages = [
  { label: 'JavaScript', value: 'javascript' },
  { label: 'Python', value: 'python' },
  { label: 'Java', value: 'java' },
  { label: 'C++', value: 'cpp' },
  { label: 'C', value: 'c' },
  { label: 'Go', value: 'go' },
  { label: 'Rust', value: 'rust' }
]

// 获取题目详情
const getProblemInfo = async () => {
  loading.value = true
  try {
    const problemId = route.params.id
    const response = await getProblemDetail(problemId)

    if (response.code === 200) {
      problem.value = response.data
      await loadCodeTemplate()
      await loadSubmissions()
      await loadDiscussions()
    } else {
      ElMessage.error(response.message || '获取题目详情失败')
    }
  } catch (error) {
    console.error('获取题目详情失败:', error)
    ElMessage.error('获取题目详情失败')
  } finally {
    loading.value = false
  }
}

// 加载代码模板
const loadCodeTemplate = async () => {
  try {
    const response = await getCodeTemplate(route.params.id, selectedLanguage.value)
    if (response.code === 200) {
      code.value = response.data.template || ''
    }
  } catch (error) {
    console.error('获取代码模板失败:', error)
  }
}

// 加载提交记录
const loadSubmissions = async () => {
  try {
    const response = await getProblemSubmissions(route.params.id, { pageNum: 1, pageSize: 20 })
    if (response.code === 200) {
      submissions.value = response.data.records || []
    }
  } catch (error) {
    console.error('获取提交记录失败:', error)
  }
}

// 加载讨论
const loadDiscussions = async () => {
  try {
    const response = await getProblemDiscussions(route.params.id, { pageNum: 1, pageSize: 10 })
    if (response.code === 200) {
      discussions.value = response.data.records || []
    }
  } catch (error) {
    console.error('获取讨论失败:', error)
  }
}

// 切换编程语言
const changeLanguage = async () => {
  await loadCodeTemplate()
}

// 运行代码
const runCode = async () => {
  if (!code.value.trim()) {
    ElMessage.warning('请先输入代码')
    return
  }

  runningCode.value = true
  runResult.value = null

  try {
    const response = await runCode({
      problemId: route.params.id,
      language: selectedLanguage.value,
      code: code.value
    })

    if (response.code === 200) {
      runResult.value = response.data
      if (response.data.success) {
        ElMessage.success('代码运行成功')
      } else {
        ElMessage.error('代码运行失败')
      }
    } else {
      ElMessage.error(response.message || '代码运行失败')
    }
  } catch (error) {
    console.error('代码运行失败:', error)
    ElMessage.error('代码运行失败')
  } finally {
    runningCode.value = false
  }
}

// 提交代码
const submitCode = async () => {
  if (!code.value.trim()) {
    ElMessage.warning('请先输入代码')
    return
  }

  submittingCode.value = true
  submitResult.value = null

  try {
    const response = await submitCode({
      problemId: route.params.id,
      language: selectedLanguage.value,
      code: code.value
    })

    if (response.code === 200) {
      submitResult.value = response.data
      if (response.data.status === 'ACCEPTED') {
        ElMessage.success('恭喜！代码提交成功')
      } else {
        ElMessage.error('代码提交失败，请检查代码')
      }

      // 刷新提交记录
      await loadSubmissions()
    } else {
      ElMessage.error(response.message || '代码提交失败')
    }
  } catch (error) {
    console.error('代码提交失败:', error)
    ElMessage.error('代码提交失败')
  } finally {
    submittingCode.value = false
  }
}

// 重置代码
const resetCode = async () => {
  await loadCodeTemplate()
  ElMessage.success('代码已重置')
}

// 收藏题目
const toggleFavorite = async () => {
  try {
    if (isFavorited.value) {
      await unfavoriteProblem(route.params.id)
      isFavorited.value = false
      ElMessage.success('取消收藏成功')
    } else {
      await favoriteProblem(route.params.id)
      isFavorited.value = true
      ElMessage.success('收藏成功')
    }
  } catch (error) {
    console.error('收藏操作失败:', error)
    ElMessage.error('操作失败')
  }
}

// 工具函数
const getDifficultyType = (difficulty) => {
  const typeMap = {
    '简单': 'success',
    '中等': 'warning',
    '困难': 'danger'
  }
  return typeMap[difficulty] || 'info'
}

const getStatusText = (status) => {
  const statusMap = {
    'ACCEPTED': '通过',
    'WRONG_ANSWER': '答案错误',
    'TIME_LIMIT_EXCEEDED': '超时',
    'MEMORY_LIMIT_EXCEEDED': '内存超限',
    'RUNTIME_ERROR': '运行错误',
    'COMPILE_ERROR': '编译错误',
    'PRESENTATION_ERROR': '格式错误'
  }
  return statusMap[status] || status
}

const getSubmissionClass = (status) => {
  return status === 'ACCEPTED' ? 'success' : 'error'
}

const formatTime = (time) => {
  return new Date(time).toLocaleString()
}

const refreshSubmissions = () => {
  loadSubmissions()
}

const viewSubmissionDetail = (submission) => {
  // 查看提交详情
  router.push(`/coding/submission/${submission.id}`)
}

const createDiscussion = () => {
  // 创建讨论
  ElMessage.info('创建讨论功能开发中...')
}

const viewDiscussion = (discussion) => {
  // 查看讨论详情
  router.push(`/coding/discussion/${discussion.id}`)
}

const showSolution = () => {
  // 查看题解
  router.push(`/coding/problem/${route.params.id}/solution`)
}

onMounted(() => {
  getProblemInfo()
})
</script>

<style lang="scss" scoped>
.coding-problem-container {
  min-height: 100vh;
  background: var(--el-bg-color-page);
}

.problem-header {
  background: white;
  border-bottom: 1px solid var(--el-border-color-lighter);
  padding: 24px 0;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.breadcrumb {
  margin-bottom: 16px;
}

.problem-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--el-text-color-primary);
}

.problem-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--el-text-color-secondary);
}

.problem-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.problem-actions {
  display: flex;
  gap: 12px;
}

.problem-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 600px;
  gap: 24px;

  @media (max-width: 1200px) {
    grid-template-columns: 1fr;
  }
}

.problem-description {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.description-tabs {
  :deep(.el-tabs__header) {
    margin: 0;
    background: var(--el-fill-color-extra-light);
    padding: 0 24px;
  }

  :deep(.el-tabs__content) {
    padding: 24px;
  }
}

.description-content {
  .section {
    margin-bottom: 32px;

    &:last-child {
      margin-bottom: 0;
    }

    h3 {
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 16px;
      color: var(--el-text-color-primary);
    }

    .content {
      line-height: 1.6;
      color: var(--el-text-color-regular);
    }
  }
}

.example-item {
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;

  h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--el-text-color-primary);
  }
}

.example-content {
  .input-output {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;

    @media (max-width: 768px) {
      grid-template-columns: 1fr;
    }
  }

  .input-section,
  .output-section {
    strong {
      display: block;
      margin-bottom: 8px;
      color: var(--el-text-color-primary);
    }

    pre {
      background: var(--el-fill-color-extra-light);
      padding: 12px;
      border-radius: 6px;
      font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
      font-size: 14px;
      line-height: 1.4;
      margin: 0;
      overflow-x: auto;
    }
  }

  .explanation {
    padding-top: 12px;
    border-top: 1px solid var(--el-border-color-extra-light);

    strong {
      display: block;
      margin-bottom: 8px;
      color: var(--el-text-color-primary);
    }
  }
}

.hints-list {
  padding-left: 20px;

  li {
    margin-bottom: 8px;
    line-height: 1.6;
  }
}

.submissions-content,
.discussions-content {
  .submissions-header,
  .discussions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;

    h3 {
      font-size: 18px;
      font-weight: 600;
    }
  }
}

.submission-item {
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;

  &:hover {
    border-color: var(--el-color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  &.success {
    border-color: var(--el-color-success);
    background: var(--el-color-success-light-9);
  }

  &.error {
    border-color: var(--el-color-danger);
    background: var(--el-color-danger-light-9);
  }
}

.submission-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;

  .status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
  }

  .language {
    font-size: 14px;
    color: var(--el-text-color-secondary);
  }

  .time {
    font-size: 14px;
    color: var(--el-text-color-placeholder);
  }
}

.submission-stats {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--el-text-color-secondary);
}

.discussion-item {
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;

  &:hover {
    border-color: var(--el-color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

.discussion-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;

  h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
  }

  .discussion-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: var(--el-text-color-secondary);
  }
}

.discussion-preview {
  color: var(--el-text-color-regular);
  margin-bottom: 8px;
  @include text-ellipsis(2);
}

.discussion-stats {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--el-text-color-placeholder);
}

.code-editor-section {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  height: fit-content;
  max-height: calc(100vh - 200px);
  position: sticky;
  top: 24px;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--el-border-color-lighter);
  background: var(--el-fill-color-extra-light);
}

.editor-actions {
  display: flex;
  gap: 8px;
}

.code-editor {
  flex: 1;
  min-height: 400px;

  .code-textarea {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
    outline: none;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: #1e1e1e;
    color: #d4d4d4;

    &::placeholder {
      color: #6a6a6a;
    }
  }
}

.run-result,
.submit-result {
  border-top: 1px solid var(--el-border-color-lighter);

  .result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--el-fill-color-extra-light);

    h4 {
      font-size: 16px;
      font-weight: 600;
    }
  }

  .result-content {
    padding: 20px;
  }
}

.success-result {
  .output-section {
    margin-bottom: 16px;

    strong {
      display: block;
      margin-bottom: 8px;
    }

    pre {
      background: var(--el-fill-color-extra-light);
      padding: 12px;
      border-radius: 6px;
      font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
      font-size: 14px;
      margin: 0;
    }
  }

  .stats-section {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--el-text-color-secondary);
  }
}

.error-result {
  .error-type {
    font-weight: 600;
    color: var(--el-color-danger);
    margin-bottom: 8px;
  }

  .error-message {
    background: var(--el-color-danger-light-9);
    color: var(--el-color-danger);
    padding: 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    margin: 0;
  }
}

.result-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;

  &.accepted {
    color: var(--el-color-success);
  }

  &:not(.accepted) {
    color: var(--el-color-danger);
  }
}

.success-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;

  .stat-item {
    display: flex;
    justify-content: space-between;

    .label {
      color: var(--el-text-color-secondary);
    }

    .value {
      font-weight: 600;
      color: var(--el-color-success);
    }
  }
}

.error-details {
  .error-case {
    background: var(--el-color-danger-light-9);
    padding: 16px;
    border-radius: 8px;

    strong {
      display: block;
      margin-bottom: 12px;
      color: var(--el-color-danger);
    }

    .case-input,
    .case-output,
    .case-actual {
      margin-bottom: 12px;

      &:last-child {
        margin-bottom: 0;
      }

      span {
        font-weight: 600;
        color: var(--el-text-color-primary);
      }

      pre {
        background: white;
        padding: 8px;
        border-radius: 4px;
        font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
        font-size: 14px;
        margin: 4px 0 0 0;
      }
    }
  }
}

.empty-submissions {
  text-align: center;
  padding: 40px 20px;
}
</style>